import type { IModalConfig } from '@/components/page-modal'

const modalConfig: IModalConfig = {
  pageName: 'menu',
  header: {
    newTitle: '新建菜单',
    editTitle: '编辑菜单'
  },
  formIsInline: false,
  formlabelWidth: '80',
  modalWidth: '30%',
  // formIsInline: true,
  // formlabelWidth: '50',
  // modalWidth: '40%',
  formItems: [
    {
      type: 'input',
      prop: 'name',
      label: '部门名称',
      placeholder: '请输入部门名称',
      initalValue: '',
      // lg: 8,
      // md: 8,
      // sm: 12,
      span: 24,
      rules: [
        { required: true, message: '请输入部门名称', trigger: 'blur' },
        {
          message: '请输入部门名称不能少于3位',
          validator: (_rule: any, value: any, cb: Function) => {
            if (value.length < 3) {
              cb(new Error('请输入部门名称不能少于3位'))
            } else {
              cb()
            }
          },
          trigger: 'change'
        }
      ]
    },
    {
      type: 'input',
      prop: 'leader',
      label: '部门领导',
      placeholder: '请输入部门领导',
      initalValue: '',
      // lg: 8,
      // md: 8,
      // sm: 12
      span: 24
    },
    {
      type: 'select',
      prop: 'parentId',
      label: '上级领导',
      placeholder: '请选择上级领导',
      initalValue: '',
      // lg: 8,
      // md: 8,
      // sm: 12,
      span: 24,
      options: []
    }
  ],
  titleTip: '部门'
}

export default modalConfig
